package com.um.jdy.app.base.controller;

import com.um.jdy.app.base.entity.vo.AboutVO;
import com.um.jdy.app.base.entity.vo.AreaTreeNode;
import com.um.jdy.app.base.manager.AppManager;
import com.um.jdy.common.platform.entity.vo.AgreementVO;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "基础")
@RestController
@RequestMapping("/api/v1/app")
public class AppController {

    @Autowired
    AppManager appManager;

    @ApiOperation("查询小程序信息")
    @GetMapping("about")
    public Response<AboutVO> about(){
        return Response.success(appManager.getAbout());
    }

    @ApiOperation("查询地区数")
    @GetMapping("/area/tree")
    public Response<List<AreaTreeNode>> getAreaData() {
        return Response.success(appManager.getAreaTree());
    }

    @ApiOperation("平台协议")
    @GetMapping("agreement")
    public Response<AgreementVO> getAgreement() {
        return Response.success(appManager.getAgreement());
    }

}
